<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@include file="../taglib_includes.jsp" %>
<html dir="ltr">

<head>
    <title><spring:message code="App.Title"></spring:message> </title>
        <script type="text/javascript" src="js/jquery-main.js"></script>
</head>

  <body>
    <div id="content_wrapper" >

	  <h1>Edit Configuration</h1>
	  <h3>General Settings</h3>
     </div>

    <div id="page-yield">
  <form:form action="updateInstituteDetail.htm" method="post" commandName="updateInstituteDetail">
   <div style="margin:0;padding:0;display:inline">
     <input name="authenticity_token" type="hidden" value="1uNy9n/9IpxRElXWyE876ETRgk5sNrQ/eTrowyksC3w=" />
    </div>
      <div class="label-field-pair">
        <label for="institution_name_type">School/College Name</label>
        <div class="text-input-bg">
          <input id="institution_name" name="name" size="30" type="text" value="${editInstituteDetail.name}" />
        </div>
        <div>
         <form:errors path="name" cssStyle="color:red"></form:errors> 
        </div>        
      </div>
      <div class="label-field-pair">
        <label for="address_type">School/College Address</label>
        <div class="text-input-bg">
          <input id="institution_address" name="address" size="30" type="text" value="${editInstituteDetail.address}" />
        </div>
      </div>
      <div class="label-field-pair">
        <label for="phone_type">School/College Phone</label>
        <div class="text-input-bg">
          <input id="institution_phone_no" name="phoneNo" size="30" type="text" value="${editInstituteDetail.phoneNo}" />
        </div>
      </div>

      <div class="label-field-pair">
        <label for="time_zone_type">Time Zone</label>
        <div class="text-input-bg">
         <select name="institution_time_zone" id="timeZoneId">
			<option value="">Select</option>
			<c:forEach var="tz" items="${sessionScope.timeZones}">
			<option value="${tz.id}" <c:if test="${editInstituteDetail.timeZoneId == tz.id}"> selected="selected" </c:if>>(UTC${tz.timeZoneOffset}) ${tz.timeZoneId}</option>
			</c:forEach>
		 </select>
        </div>
      </div>

      <div class="label-field-pair">
        <label for="default_country">Country</label>
        <div class="text-input-bg">          
<!--           <select id="institution_country" name="countryId">
			<option value="1">Afghanistan</option>
			<option value="2">Albania</option>
			<option value="195">Zimbabwe</option>
		 </select> -->
        
<input type="hidden" id="city" name="cityId" value="${editInstituteDetail.cityId}" />
<c:set var="cityName" value="${editInstituteDetail.city.cityName}"></c:set>
<c:if test="${not empty editInstituteDetail.city.state}">
<c:set var="cityName" value="${cityName}(${editInstituteDetail.city.state.stateName}"></c:set>
</c:if>
<c:if test="${not empty editInstituteDetail.city.state.country}">
<c:set var="cityName" value="${cityName}, ${editInstituteDetail.city.state.country.countryName})"></c:set>
</c:if>
<c:if test="${empty cityName}">
<c:set var="cityName" value="Search here"></c:set>
</c:if>

<input type="text" id="cityName" name="cityName" size="30" class="input150"  value="${cityName}" onfocus="if(this.value=='Search here') this.value='';"
onblur="if(this.value=='') {this.value='Search here';$('#city').val('');}" />
        
<script type="text/javascript">
var cityName = $('#cityName');
cityName.autocomplete('cityNameList.htm', { minChars:2, max:100, cacheLength:100, matchContains:true, autoFill:false, selectFirst:false });       
cityName.result(function(event, data, formatted) {
$('#cityName').val(data[0]);
$('#city').val(data[1]);
});
</script>
        
        
        
        </div>
      </div>
      
      <div class="label-field-pair">
        <label for="institution_currency_type">Currency Type</label>
        <div class="text-input-bg">
          <select id="institution_currency" name="currencyId">
			<option value="currency" selected="selected">Select Currency</option>
			<c:forEach items="${sessionScope.currencies}" var="currency">
			<option value="${currency.id}" <c:if test="${editInstituteDetail.currencyId == currency.id}"> selected="selected" </c:if>>${currency.code} (${currency.symbol})</option>
			</c:forEach>
		 </select>
        </div>
      </div>
      <div class="label-field-pair">
        <label for="institution_logo_type">Upload Logo</label>
        <div class="text-input-bg">
          <input id="institution_logo" name="logoUrl" size="12" type="file" />
        </div>
      </div>

      <div class="extender"></div>
     
      <div id="submit-button">
        <input name="commit" type="submit" value="Submit" />
        <input name="id" type="hidden" value="${param.id }" />
      </div>
    </form:form>
  </div>

  </body>
</html>
